package com.sino.business.service;

import com.sino.bean.Qtzk;
import com.sino.business.IQtzkService;
import com.sino.dao.IBasicInfoDAO;
import com.sino.model.QtzkModel;

public class QtzkServiceImp implements IQtzkService{
	private IBasicInfoDAO basicInfoDAO = null;
	/**
     * Description       	   ：保存专利保护状况信息到数据库中
     * @param qtzkModel	 	   ：其他状况基础对象
     */
	public void saveQtzk(QtzkModel qtzkModel){
		Qtzk qtzk = new Qtzk();
		qtzk.setQtinfo(qtzkModel.getQtinfo());
		qtzk.setShgxinfo(qtzkModel.getShgxinfo());
		qtzk.setZlid(qtzkModel.getZlid());
		if(this.getBasicInfoDAO().findQtzkByIdClear(qtzkModel.getZlid()) != null){
			this.getBasicInfoDAO().updateQtzk(qtzk);
		}else{
			this.getBasicInfoDAO().saveQtzk(qtzk);
		}
	}
	/**
     * Description       	   ：更新专利保护状况信息到数据库中
     * @param qtzkModel	 	   ：其他状况基础对象
     */
	public void updateQtzk(QtzkModel qtzkModel){}
	/**
     * Description       	   ：根据id查找其他情况信息
     * @param zlid		 	   ：专利id
     */
	public QtzkModel findQtzk(String zlId){
		QtzkModel qtzkModel = new QtzkModel();
		Qtzk qtzk = this.getBasicInfoDAO().findQtzkById(zlId);
		if(qtzk == null){
			return qtzkModel;
		}
		qtzkModel.setQtinfo(qtzk.getQtinfo());
		qtzkModel.setShgxinfo(qtzk.getShgxinfo());
		qtzkModel.setZlid(qtzk.getZlid());
		return qtzkModel;
	}
	//------------------------------数据接口
	public IBasicInfoDAO getBasicInfoDAO() {
		return basicInfoDAO;
	}
	public void setBasicInfoDAO(IBasicInfoDAO basicInfoDAO) {
		this.basicInfoDAO = basicInfoDAO;
	}
	
	
}
